package com.itheima.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GroupItemMapper {

    /**
     * 添加检查项到检查组
     * @param checkGroupId:检查组id
     * @param checkItemIds:检查项id
     */
    void addItemToGroup(Integer checkGroupId, Integer checkItemIds);

    /**
     * 根据检查组id删除检查项
     * @param id:检查组id
     */
    @Delete("delete from t_checkgroup_checkitem where checkgroup_id = #{id}")
    void deleteItemFromGroup(Integer id);

    /**
     * 根据检查组id查询检查项id集合
     * @param checkGroupId
     * @return
     */
    @Select("select checkitem_id from t_checkgroup_checkitem where checkgroup_id = #{checkGroupId}")
    List<Integer> findCheckItemIdsByCheckGroupId(Integer checkGroupId);
}
